<?
if(isset($_POST['arclet'])) {
$arclings=array();
$i=0;
foreach($_POST as $key=>$val) {
if($key!="arclet" AND $val!="") {
$arclings[$i]=$val;
$i++;
}
}
if($i<3) {
echo "There are not enough members of ARC to create and ARClet";
echo "<br /><a href=\"" . $_SERVER['PHP_SELF'] . "\">Back</a>";
die;
}
$members[0]=0;
$members[1]=0;
$members[2]=0;
while(($members[0]==$members[1]) OR ($members[0]==$members[2]) OR ($members[1]==$members[2])) {
for($j=0;$j<3;$j++) {
  $members[$j]=rand(0,($i-1));
}
}
echo $arclings[$members[0]] . "<br />" . $arclings[$members[1]] . "<br />" . $arclings[$members[2]] . "<br />";
echo "<br /><a href=\"" . $_SERVER['PHP_SELF'] . "\">Back</a>";
die;
}

echo "
<form action=\"" . $_SERVER['PHP_SELF'] . "\" method=\"post\">
Put in all the members of ARC, 1 ARCling per box. Do not skip any boxes. Indeed. ARCtastic.
<br />
<table border=\"0\">
<tr><td>
";

for($i=0;$i<200;$i++) {
  echo "<input type=\"text\" name=\"box" . $i . "\"><br />";
}
echo "
</td><td valign=\"top\">
<input type=\"submit\" name=\"arclet\" value=\"Generate ARClet\">
</td></tr>
</table>
</form>
";

